# -*- coding: utf-8 -*-
def create_app():
    from flask import Flask
    from configuration import load_config

    app = Flask(__name__, instance_relative_config=True)

    # Load config
    config = load_config()
    app.config.from_object(config)
    app.config.from_pyfile("config.py", silent=True)

    # 注册蓝图
    from app.views.home import home
    app.register_blueprint(home, url_prefix='/<channel_code>')

    return app
